import http from "@/utils/http"

/**
 * 添加收货地址
 * @param {Object} data 
 * @returns 
 */
export function postMemberAddress(data) {
    return http({
        url: '/member/address',
        method: 'post',
        data
    })
}
/**
 * 获取收货地址列表
 * @returns 
 */
export function getMemberAddress() {
    return http({
        url: '/member/address'
    })
}

/**
 * 查询收货地址详情
 * @returns 
 */
export function getMemberAddressDetail(id) {
    return http({
        url: `/member/address/${id}`
    })
}

/**
 * 更新收货地址
 * @param {Object} id 
 * @param {Object} data 
 * @returns 
 */
export function putMemberAddress(id, data) {
    return http({
        url: `/member/address/${id}`,
        method: 'put',
        data
    })
}

/**
 * 删除收货地址
 * @returns 
 */
export function deleteMemberAddress(id) {
    return http({
        url: `/member/address/${id}`,
        method:'delete'
    })
}